<h1><g:message code="user.profile.profile"/></h1>

<h2><g:message code="user.profile.changeData"/></h2>

<g:hasErrors bean="${user}">
<div class="errors">
	<g:renderErrors bean="${user}"></g:renderErrors>
</div> 
</g:hasErrors>

<g:form action="profile" name="registerForm">
	<div class="formField">
		<label for="login"><g:message code="user.profile.oldPassword"/>:</label>
		<g:textField name="oldPassword"></g:textField>
	</div>

	<div class="formField"> 
		<label for="password"><g:message code="user.profile.newPassword"/>:</label>
		<g:passwordField name="newPassword"></g:passwordField> 
	</div>

	<div class="formField"> 
		<label for="confirm"><g:message code="user.profile.confirmPassword"/>:</label>
		<g:passwordField name="confirmNewPassword"></g:passwordField> 
	</div>
	
	<g:hiddenField name="type" value="register"/>
	<g:submitButton class="formButton" name="change" value="${message(code:'global.ok')}"></g:submitButton> 
</g:form>

<h2><g:message code="user.profile.tickets"/></h2>

<table>
	<tr>
		<th><g:message code="user.profile.from"/></th>
		<th><g:message code="user.profile.to"/></th>
		<th><g:message code="user.profile.departure"/></th>
		<th><g:message code="user.profile.price"/></th>
	</tr>
	<g:each in="${tickets?}">
	<tr>
		<td>${it.fromPlace }</td>
		<td>${it.toPlace }</td>
		<td>${it.startTime}</td>
		<td>${it.price }</td>
	</tr>
	</g:each>
</table>

<br>
<a href="${createLink(action:'logout')}"><g:message code="global.logout"/></a>